/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-05-19
 * Time: 8:59
 */
public class Test {
    public static void eat(Animal animal) {
        animal.eat();
    }
    public static void run(IRunning iRunning) {
        iRunning.run();
    }

    public static void swim(ISwimming iSwimming) {
        iSwimming.swim();
    }
    public static void main(String[] args) {

        Dog dog = new Dog("hello",2);
        Cat cat = new Cat("perper",3);
        Robot robot = new Robot();
        run(dog);
        run(cat);
        run(robot);
        System.out.println("======");
        swim(dog);
        swim(robot);
        swim(cat);
        System.out.println("======");
        eat(dog);
        eat(cat);


    }
    public static void main1(String[] args) {

        Dog dog = new Dog("hello",2);
        Cat cat = new Cat("perper",3);
        eat(dog);
        eat(cat);

    }
}
